package id.co.rho.scoring.cid.client.helper;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.ComboBox;

/**
 * Created by IntelliJ IDEA.
 * User: frizky
 * Date: 1/16/12
 * Time: 3:50 PM
 */

/**
 * FRZ
 * Belum jadi masih ada yang error
 *
 * @param <D>
 */
public class CustomComboFilter<D extends ModelData> extends CustomStringFilter {
    protected ComboBox<D> field;

    public CustomComboFilter(final String dataIndex, ComboBox<D> field, Button submitButton, Button resetButton, boolean enableKeyListener) {
        super(dataIndex, field, submitButton, resetButton, enableKeyListener);
    }

    @Override
    public Object getValue() {
        D value = (D) field.getValue();
        String strValue = "";
        if (value != null) {
            strValue = value.get(field.getValueField());
        }
        return strValue;
    }

    @Override
    public void setValue(Object value) {
//                subEcoSecCombo.getStore().filter(subEcoSecCombo.getDisplayField(), (String) value);
    }
}
